--暖冬寒春
local nuandonghanchun = fk.CreateSkill {
    name = "mcdh_nuandonghanchun"
}

nuandonghanchun:addEffect(fk.TargetConfirming,{
    can_trigger = function(self, event, target, player, data)
        local room = player.room
        if target ~= player  and player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 then
            local firstEvent = player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
                return table.contains(TargetGroup:getRealTargets(e.data[1].tos), target)
            end, Player.HistoryTurn)[1]
            local useParent = player.room.logic:getCurrentEvent()
            return U.isOnlyTarget(target, data, event) and useParent and firstEvent and useParent.id == firstEvent.id
                    and not room:getPlayerById(data.from):isProhibited(player, data.card) and data.card.skill:modTargetFilter(player.id, {},room:getPlayerById(data.from), data.card, false)
        end
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        local discard  =room:askForDiscard(player,1,1,true,self.name,true,".","#mcdh_nuandonghanchun-discard:"..target.id.."::"..data.card:toLogString()..":"..player.hp,true)
        if #discard ~= 0  then
            self.cost_data = discard
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:throwCard(self.cost_data,self.name,player,player)
        TargetGroup:removeTarget(data.targetGroup, target)
        TargetGroup:pushTargets(data.targetGroup, player)
        target:drawCards(player.hp,self.name)
    end
})

Fk:loadTranslationTable {
    ["mcdh_nuandonghanchun"] = "暖冬寒春",
    ["#mcdh_nuandonghanchun-discard"] = "暖冬寒春:弃一张牌并令目标为%src的%arg转移给你,然后%src摸%arg2张牌",
    [":mcdh_nuandonghanchun"] = "每回合限一次，一名本回合未成为过牌的目标的其他角色成为牌的唯一目标时，你可以弃一张牌并将此牌目标转移给你，然后其摸X张牌(X为你的体力值)"
}

return nuandonghanchun